//
//package com.taobao.askwho.utils.login;
//
//import java.io.IOException;
//
//import javax.servlet.Filter;
//import javax.servlet.FilterChain;
//import javax.servlet.FilterConfig;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import com.taobao.askwho.po.UserInfo;
//import com.taobao.askwho.utils.arkclient.ArkDomain;
//import com.taobao.askwho.utils.session.SessionUtil;
//
//public class LoginFilter implements Filter {
//
//
//	public void destroy() {
//
//	}
//	public void doFilter(ServletRequest servletRequest,
//			ServletResponse servletResponse, FilterChain filterChain)
//					throws IOException, ServletException {
//
//		HttpServletRequest request = (HttpServletRequest) servletRequest;
//		HttpServletResponse response = (HttpServletResponse) servletResponse;
//		
//		String mail = ArkDomain.getArkUserEmail(request);
//		
//		//从session里取的用户名信息
//		UserInfo info = SessionUtil.getUserInfo(request);
//		//判断如果没有取到用户信息,就跳转到登陆页面
//		if (info == null) {
//			//跳转到登陆页面
//			String queryString = request.getQueryString();
//			if(queryString==null || queryString.indexOf("method=login")<0) {
//				//break;
//			} else if(queryString==null || queryString.indexOf("method=logout")<0) {
//				//break;
//			} else {
//				response.sendRedirect(request.getContextPath() + "/urljump.do?method=login");  	
//			}
//
//		}
//
//		filterChain.doFilter(servletRequest, servletResponse);
//	}
//
//	public void init(FilterConfig arg0) throws ServletException {
//
//	}
//
//
//
//	public static void main(String [] args) {
//		System.out.print("dsds");
//	}
//}
